fix(template): four defects in the server-rendered pages - #1592
Open
culfin wants to merge 1 commit into
Open
Conversation
All four sit in `ui/template/`, the pages the Go side renders for search
engines and for readers before the interface takes over. They are unrelated to
each other and each is a line or two; they arrive together because they were
all found the same way — by putting those pages in front of visitors instead of
only crawlers.
**Broken avatars in the question list.** `src="{{$.baseURL}}/users/{{.Operator.
Avatar}}"` prefixes a value that already holds the full reference, so every
question renders a broken image. The four other templates that show an avatar
use it directly. Also in that tag: `alt="shuai"`, placeholder text from a
copied DOM, now the display name; and `width="24px"`, invalid because HTML
dimension attributes take no unit, so browsers fall back to the intrinsic size
and every row grows.
**The sort dropdown ships opened.** `class="show"` on the group, the toggle and
the menu, `aria-expanded="true"`, and the inline coordinates Popper had written
when that markup was captured. Without the interface the menu stands open over
the page, and assistive technology is told a collapsed control is expanded. The
same file carries a captured React id, `react-aria8245013726-:r5:`, referenced
by an `aria-labelledby`; replaced with a stable name.
**The search placeholder is not translated.** `placeholder="Search"` written
literally, though the key exists in all 45 language files as
`ui.header.search.placeholder`. One English word in an otherwise translated
page.
**Tags print their slug, not their display name.** For Latin script that is a
matter of case; elsewhere the slug is a transliteration, so a tag named 眼镜
renders as `yan-jing`. Changed in four templates — text only, every `href`
keeps the slug.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four unrelated defects, all in
ui/template/— the pages the Go side rendersfor search engines and for readers before the interface takes over. Each is a
line or two. They arrive together because they were all found the same way: by
putting those pages in front of visitors instead of only crawlers.
They are visible on this project's own instance
Fetched from
meta.answer.dev/questionswith a Googlebot user agent:srcprefixed with/users/alt="shuai"width="24px"(invalid)react-aria…The first one is easy to check:
An HTML page where an image is expected.
The four
Broken avatars in the question list.
src="{{$.baseURL}}/users/{{.Operator.Avatar}}"prefixes a value that already holds the full reference — as the output above
shows, a complete
https://…address ends up behind/users/. The four othertemplates that display an avatar use the value directly. In the same tag:
alt="shuai"is placeholder text from a copied DOM, now the display name; andwidth="24px"is invalid, because HTML dimension attributes take no unit, sobrowsers discard it, fall back to the intrinsic size and every row of the list
grows.
The sort dropdown ships opened.
class="show"on the group, the toggle andthe menu,
aria-expanded="true", and the inline coordinates Popper had writtenwhen that markup was captured. Without the interface the menu stands open over
the page, and assistive technology is told a collapsed control is expanded. The
same file carries
id="react-aria8245013726-:r5:", referenced by anaria-labelledby; replaced with a stable name.The search placeholder is not translated.
placeholder="Search"writtenliterally, though the key exists in all 45 language files as
ui.header.search.placeholder. Invisible on an English instance, one Englishword in the middle of every other one.
Tags print their slug, not their display name. For Latin script that is a
matter of case; elsewhere the slug is a transliteration, so a tag named 眼镜
renders as
yan-jing. Changed in four templates — text only, everyhrefkeeps the slug. This is the one of the four that does not show on
meta.answer.dev, where every tag is a lowercase English word and the two areidentical.
Verified
All 14 templates parse before and after (
html/template.ParseFileswith theproject's function map).
Replaces #1583, #1584, #1585 and #1586, which are the same four changes as
separate pull requests.
🤖 Generated with Claude Code